﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace GuangHaoJie.FMS.Common

{
	public class SimpleMessage : BaseMessage
	{
		public SimpleMessage(object data, string message, int code,bool status) : base(message, code,status)
		{
			this.Data = data;
		}

		public SimpleMessage(object data, string message, int code) : base(message, code)
		{
			this.Data = data;
		}


		public SimpleMessage(object data) : base()
		{
			this.Data = data;
		}


		public object Data { get; set; }

		public TData GetData<TData>()
		{
			if (this.Data != null)
			{
				if (Data is TData data)
				{
					return data;
				}
			}
			return default(TData);
		}
	}
}
